import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '类型(支出/收入/收款/付款/转账)',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '单位Id(收款/付款单位)',
    align:"center",
    dataIndex: 'organId'
   },
   {
    title: '经手人id',
    align:"center",
    dataIndex: 'handsPersonId'
   },
   {
    title: '操作员',
    align:"center",
    dataIndex: 'creator'
   },
   {
    title: '变动金额(优惠/收款/付款/实付)',
    align:"center",
    dataIndex: 'changeAmount'
   },
   {
    title: '优惠金额',
    align:"center",
    dataIndex: 'discountMoney'
   },
   {
    title: '合计金额',
    align:"center",
    dataIndex: 'totalPrice'
   },
   {
    title: '账户(收款/付款)',
    align:"center",
    dataIndex: 'accountId'
   },
   {
    title: '单据编号',
    align:"center",
    dataIndex: 'billNo'
   },
   {
    title: '单据日期',
    align:"center",
    dataIndex: 'billTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '附件名称',
    align:"center",
    dataIndex: 'fileName'
   },
   {
    title: '状态，0未审核、1已审核、9审核中',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: '单据来源，0-pc，1-手机',
    align:"center",
    dataIndex: 'source'
   },
   {
    title: '租户id',
    align:"center",
    dataIndex: 'tenantId'
   },
   {
    title: '删除标记，0未删除，1删除',
    align:"center",
    dataIndex: 'deleteFlag'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '类型(支出/收入/收款/付款/转账)',
    field: 'type',
    component: 'Input',
  },
  {
    label: '单位Id(收款/付款单位)',
    field: 'organId',
    component: 'InputNumber',
  },
  {
    label: '经手人id',
    field: 'handsPersonId',
    component: 'InputNumber',
  },
  {
    label: '操作员',
    field: 'creator',
    component: 'InputNumber',
  },
  {
    label: '变动金额(优惠/收款/付款/实付)',
    field: 'changeAmount',
    component: 'InputNumber',
  },
  {
    label: '优惠金额',
    field: 'discountMoney',
    component: 'InputNumber',
  },
  {
    label: '合计金额',
    field: 'totalPrice',
    component: 'InputNumber',
  },
  {
    label: '账户(收款/付款)',
    field: 'accountId',
    component: 'InputNumber',
  },
  {
    label: '单据编号',
    field: 'billNo',
    component: 'Input',
  },
  {
    label: '单据日期',
    field: 'billTime',
    component: 'DatePicker',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '附件名称',
    field: 'fileName',
    component: 'Input',
  },
  {
    label: '状态，0未审核、1已审核、9审核中',
    field: 'status',
    component: 'Input',
  },
  {
    label: '单据来源，0-pc，1-手机',
    field: 'source',
    component: 'Input',
  },
  {
    label: '租户id',
    field: 'tenantId',
    component: 'InputNumber',
  },
  {
    label: '删除标记，0未删除，1删除',
    field: 'deleteFlag',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}